GCC: An Industrial-Strength Compiler

GCC is the compiler system of the GNU environment. GNU (a self-referential acronym for ``GNU is Not Unix'') is a Unix-compatible operating system, being developed by the Free Software Foundation, and distributed under the GNU Public License (GPL). GNU software is always distributed with its sources, and the GPL enjoins anyone who modifies GNU software and then redistributes the modified product to supply the sources for the modifications as well. In this fashion, enhancements to the original software benefit the software community at large [#gnu-manual##1###].

GCC is today the centerpiece of the GNU software. GCC is a retargetable and rehostable compiler system, with multiple front-ends and a large number of hardware targets. Originally designed as a compiler for C, it now includes front-ends for C<#60#>++<#60#>, Modula-3, Fortran, Objective-C, and most recently Ada. Technically, the crucial asset of the GCC is its mostly language-independent, target-independent code generator, which produces code of excellent quality both for CISC machines such as the Intel and Motorola families, as well as RISC machines such as the IBM RS/6000, the DEC Alpha, or the MIPS R4000. Remarkably, the machine dependences of the code generator represent less than 10 of the total code. To add a new target to GCC, an algebraic description of each machine instruction must be given using a register-transfer language. Most of the code generation and optimization then uses the RTL, which GCC maps when needed into the target machine language. The leverage of constructing a front-end for GCC is thus enormous: GNAT potentially has over 30 targets, and runs already on more that half-a-dozen of them. An Ada9X cross-compiler for a Motorola real-time controller chip was built in a few days using standard GCC configuration tools for cross-compilation. Furthermore, GCC produces high-quality code, comparable to that of the best commercial compilers.